!pr1
Commented Listing of ProDOS QUIT Code......Bob Sander-Cederlof

After reading Mark Jackson's article on improving the ProDOS QUIT code, I though it would be nice to have a commented listing of that program.  The listing which follows is just that.

The ProDOS QUIT code is booted into $D100-D3FF in the alternate $D000 bank (the one you get by diddling $C083).  Normally ProDOS MLI stays in the $C08B side.  When a program issues the QUIT call (MLI code $65), the contents of $D100-D3FF are copied to $1000-12FF; then ProDOS jumps to $1000.

If you BLOAD the SYS file named PRODOS from a bootable ProDOS 1.1.1 disk, and examine it, you will find that it is laid out in eight parts.  The first part is a relocator, which copies the other seven parts into their normal homes.  Like this:

       Position        Position
       as loaded       copied to
       ---------------------------------------------------
       2000-29FF       ---             Relocator
       2A00-2BFF       Aux 200-3FF     /RAM/ driver
       2C00-2C7F       FF00-FF7F       /RAM/ driver
       2C80-2CFF       nowhere         All zeroes
       2D00-4DFF       D000-F0FF       MLI Kernel
       4E00-4EFF       BF00-BFFF       System Global Page
       4F00-4F7F       D742-D7BD       Thunderclock driver
       4F80-4FFF       FF80-FFFF       Interrupt Code
       5000-56FF       F800-FEFF       Device Drivers
       5700-59FF       D100-D3FF(alt)  QUIT Code
       zeroes          F100-F7FF

The part I am interested in right now is the QUIT code, which is at $5700-$59FF in the PRODOS file.

The QUIT code is not written very efficiently.  For some reason, there are two completely separate editing programs:  one for the prefix, and another for the pathname.  (And as Mark points out, neither one is very handy.)  Even the code that initializes the BITMAP is inefficient.

